﻿/****************************** Module Header ******************************\

Copyright (c) Gary Davidson

This source is subject to the Microsoft Public License.
See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
All other rights reserved.

THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
\***************************************************************************/
using System.Linq;
using Microsoft.EnterpriseManagement.Common;

namespace Savviety.ServiceManager.Facade
{
    public partial class System_User
    {

        public static EnterpriseManagementObject GetFromEmail(string emailAddress)
        {
            //const string property = "$Target/Path[Relationship='SupportingItemLibrary!System.UserHasPreference' TypeConstraint='NotificationLibrary!System.Notification.Endpoint']/Property[Type='NotificationLibrary!System.Notification.Endpoint']/TargetAddress$";

            //var criteriaFactory = new CriteriaBuilder();
            //criteriaFactory.AddReferences("System.Notifications.Library", "NotificationLibrary");
            //criteriaFactory.AddReferences("System.SupportingItem.Library", "SupportingItemLibrary");

            //var criteria = criteriaFactory.CreateSimpleCriteria(TypeProjections.TypeProjections.,
            //                                                    property, emailAddress);

            //return SCSMServer.GetObjectProjectionReader(criteria, ObjectQueryOptions.Default).FirstOrDefault().Object;

            return null;

        }
    }
}
